import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'app-content',
  templateUrl: './content.component.html',
  styleUrls: ['./content.component.css']
})
export class ContentComponent implements OnInit {
  public books: Array<Book>;
  constructor() { }

  ngOnInit() {
    this.books =  [
      new Book('Think In Java', 'Tom', '2017-01-01', 4.5),
      new Book('Think In Spring', 'Tik', '2017-02-01', 3),
      new Book('Think In Angular', 'OOP', '2017-03-01', 2)
    ];
  }

}

export class Book {
  constructor(
    public name: string,
    public author: string,
    public publish: string,
    public grade: number
  ) {
  }
}
